/********************************************
 * 功能说明: 
 * 模块名称: 
 * 系统名称: 
 * 软件版权: Frank
 * 系统版本: 1.0.0
 * 开发人员: Frank
 * 开发时间: 2020/3/2 15:34
 * 审核人员: 
 * 相关文档: 
 * 修改记录: 修改日期 修改人员 修改说明
 *********************************************/
package com.spring.arch.datasource.core.annotation;

import com.spring.arch.datasource.core.configuration.InstanceDataSourceConfig;
import com.spring.arch.datasource.core.configuration.InstanceDataSourceConfig;
import org.springframework.context.annotation.Import;
import org.springframework.core.annotation.AliasFor;
import org.springframework.data.jpa.repository.config.EnableJpaRepositories;

import java.lang.annotation.*;

/**
 * 开启多数据源
 *
 * @author Frank
 * @version 1.0.0.1
 * @since 2020/3/2 15:34
 */
@Target({ElementType.TYPE})
@Retention(RetentionPolicy.RUNTIME)
@Documented
@Inherited
@EnableJpaRepositories(
        entityManagerFactoryRef = "instanceEntityManagerFactory",
        transactionManagerRef = "instanceTransactionManager")
@Import({InstanceDataSourceConfig.class})
public @interface EnableMultiDatasource {

    @AliasFor(annotation = EnableJpaRepositories.class, attribute = "basePackages")
    String basePackages() default "";
}
